package com.cloud.rabbitmq.consumer;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author 普通消费者
 * @Version 1.0
 * @Description TODO
 * @Date 20/8/19
 */
@Component
public class SimpleConsumer {
    @RabbitListener(queuesToDeclare = @Queue("rabbit.simple.queue"))
    public void listen(String msg) {
        System.out.println("简单队列 接收到消息1：" + msg);
    }

    @RabbitListener(queuesToDeclare = @Queue("rabbit.simple.queue"))
    public void listens(String msg) {
        System.out.println("简单队列 接收到消息2：" + msg);
    }
}